
DOCKER_VER=230831
DOCKER_NAME=we-dash-role
DOCKER_GROUP=chenjingdong
HOST=10.2.1.130
USER=uploader
PASS=123456

docker:
	set DOCKER_BUILDKIT=0
	docker build --tag=$(DOCKER_GROUP)/$(DOCKER_NAME):$(DOCKER_VER) -f docker/Dockerfile .

save:
	- mkdir -p ../../docker-tars/
	docker save -o ../../docker-tars/${DOCKER_NAME}-$(DOCKER_VER).tar $(DOCKER_GROUP)/$(DOCKER_NAME):$(DOCKER_VER)

sftp:
	- echo $(PASS)
	scp ../../docker-tars/we-dash-pmo-$(DOCKER_VER).tar $(USER)@$(HOST):/opt/docker-tars


.PHONY: everything docker sftp save compose

everything: docker save sftp